<template>
  <ListCard v-if="top4ListRendonly.length" :source="top4ListRendonly" typeName="书签" title="书签和清单" :recordLog="recordLog"/>
</template>
<script setup name="InfoCard">
import ListCard from './ListCard.vue';

import { inject, onMounted, onActivated } from 'vue';
import useSymbols from '../../compostions/useSymbols';
import { TYPE_NAME_SHU_QIAN } from '../../util/constant';

const { getTop4List, top4ListRendonly , setVisitItem } = inject(useSymbols);

// 统计
const recordLog = (id) => {
  setVisitItem(id, TYPE_NAME_SHU_QIAN);
  getTop4List();
} 

onMounted(() => {
  getTop4List();
});

onActivated(() => {
  getTop4List();
});
</script>
